<?php
//SQL LOGIN
$username="pepgsou_admin";
$password="_20pepg09";
$database="pepgsou_main";
$hostname="localhost";
mysql_connect($hostname,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");

$d = "$title";

	$initTitle = "South Salem High School - Courses $d";

$query = "SELECT * FROM JL WHERE Dept = \"$d\"";
$result = mysql_query($query);
$num=mysql_num_rows($result);
	
$style="<link href=\"http://www.southsaxons.com/sshs.css\" rel=\"stylesheet\" type=\"text/css\" /><style>\n .opacityFont array(\n filter:alpha(opacity=75);\n -moz-opacity:.75; \n opacity:.75; \n ) \n .opacity array(\n background-color: #FFF;\n filter:alpha(opacity=75);\n -moz-opacity:.75;\n opacity:.75;\n border: 1px solid #000;\n color: #000;\n )\n </style>";
echo "<HTML><HEAD><TITLE>$initTitle</TITLE>$style";
echo "</HEAD>";

?>
<body>
<center><div id="main" class="opacity" style="width:75%;height:100%;"><center>
<?
	$t = "_courses_Course";
	echo "<a href=\"index.php\">Switch to course list</a><br>";
	for ($i = $start; $i <= $end; $i++)
	{
		echo "<embed src=\"courses/$i$t Bulletin 09-10 Final CopyZ.pdf#toolbar=0&navpanes=0&scrollbar=0\" width=\"800\" height=\"1100\"></embed>";
	}

echo "<center><table width=75%>\n";
echo "<tr>\n<td align=\"center\"> Displaying courses 1 - $num </td>\n</tr>\n";
echo "<table width=75%>";
echo "<tr><hr></tr>";

	for ($i = 0; $i < $num; $i++) 
	{
		$cid = mysql_result($result,$i,"SEQ");
		$course_title = mysql_result($result,$i,"Title");
		$dept = mysql_result($result,$i,"Dept");
		$course_number = mysql_result($result,$i,"CourseID");
		$credit = mysql_result($result,$i,"Credit");
		$OUS = mysql_result($result,$i,"OUS");
		$NCAA = mysql_result($result,$i,"NCAA");
		$repeat_credit = mysql_result($result,$i,"Repeatable");
		$upper_req = mysql_result($result,$i,"MaxGrade");
		$lower_req = mysql_result($result,$i,"MinGrade");
		$course_desc = mysql_result($result,$i,"Description");
		$prereq = mysql_result($result,$i,"PreReq");
		
		echo "<table width=75%>\n";
		echo "<tr>\n<td width=50%><font size=\"4\"> $course_title </font></td>\n<td width=50% align=\"right\"> $course_number &nbsp;&nbsp;&nbsp;&nbsp; Credit:$credit </td>\n</tr>\n";
		echo "</table>\n";
		echo "<table width=75%>\n";
		echo "<tr>\n<td width=100% align=\"right\"> OUS:$OUS &nbsp;&nbsp;&nbsp;&nbsp; NCAA:$NCAA &nbsp;&nbsp;&nbsp;&nbsp; Repeat for Credit:$repeat_credit &nbsp;&nbsp;&nbsp;&nbsp; Grade Level:$upper_req - $lower_req</td>\n</tr>\n";
		echo "<tr>\n<td> $course_desc </td>\n</tr>\n";
		echo "<tr>\n<td align=\"right\"> $prereq &nbsp;&nbsp;&nbsp;&nbsp; Department:$dept </td>\n</tr>\n";
		echo "</table>\n";
		echo "<table width=75%>\n";
		echo "<tr><hr></tr>\n";
		echo "</table>\n";
	}
	
?></table>
</center></div></center>
</body>
</html>